package com.example.petshop.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.petshop.entity.Goods;
import com.example.petshop.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

@Mapper

public interface GoodsMapper  extends BaseMapper<Goods> {
    List<Goods> getAll();

    Optional<Goods> getById(@Param("goodsId") Integer goodsId);


    List<Goods> findGoodsByShopId(@Param("shopId") Integer shopId);


    List<Goods> getByState(int state);

    int insert(Goods goods);

    void deleteById(Integer goodsId);

    void updateGoods(Goods goods);

    Goods getGoodsByName(String goodsName);
}
